1. Technical Field
The present invention relates generally to an improved data processing system and, in particular, to a method, system and computer program product for optimizing performance in a data processing system. Still more particularly, the present invention provides a method, system, and computer program product for enhancing performance by detecting and reducing database contention and deadlock caused from within an application server.
2. Description of Related Art
An application server is a program that handles all application operations between users and an organization's backend business applications or databases. Application servers are typically used for complex transaction-based applications. The application server works as a translator, allowing, for example, a customer with a browser to search an online retailer's database for pricing information. To support high-end needs, an application server has to have built-in redundancy, monitors for high-availability, high-performance distributed application services and support for complex database access. Many application servers also offer features such as transaction management, clustering and failover, and load balancing.
As the flow of transactions in application server software running on application server hardware increases, the applications can introduce deadlocks, or serious contention issues in the database. Deadlock occurs when two processes that are sharing some resource, such as read access to a table, but then both decide to wait for exclusive access, such as write access. Contention is competition for resources that results in delayed access to resources. Such contention in the database can cause the application server to perform very poorly.
The increase in transactions can introduce a performance problem in the database, a component that the application developer and the application server administrator do not have good knowledge about or control over. The application developer may not even be aware of the major contention issues and only may be aware that an application is not scaling under load. If the database administrator is made aware of the problem, then the administrator can usually determine where in the database the problem lies, but it is difficult for the database administrator to understand or solve the problem where it originated, in the application server.
Customers need a solution that detects contention issues before a crisis occurs and then alerts the application server administrator, while keeping the applications functional.
Current solutions to the performance problems alone include code analysis, detection procedures, and transaction rollbacks. Because code analysis to detect deadlock potential does not happen during runtime, it does not provide an adequate solution. Code analysis focuses on obvious deadlocks caused by poor coding practices, which are different from deadlocks introduced through non-optimal tuning.
Procedures and code execution for database deadlock detection are normally conducted by database administrators and are not a part of the application server. A database administrator can often devise database solutions, but such solutions are usually not runtime changes. Database administrators may not communicate a problem to the application server administrator, and will seldom be motivated to make simple effective tuning changes with the application server.
A transaction rollback occurs when the application server administrator receives SQL code for a deadlock. This solution does not handle contention, and is not clean. Deadlocks and contention issues tend to pile up on each other and it is unlikely that the application server administrator will have the knowledge (or the time if they are debugging a deadlock) to tune the application server in a way that will reduce deadlock potential while the situation is resolved.
None of the current solutions deal with contention issues that do not ultimately result in a deadlock. Therefore, it would be advantageous to have an improved method, system, and computer program product for detecting and reducing contention and deadlock caused from within an application server.